projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19de2de
)
cmd: ethsw: Fix out-of-bounds error
author
York Sun
<
[email protected]
>
Tue, 13 Jun 2017 16:50:41 +0000
(09:50 -0700)
committer
Tom Rini
<
[email protected]
>
Fri, 16 Jun 2017 14:11:42 +0000
(10:11 -0400)
The for loop in cmd_keywords_opt_check() seems to use wrong array to
set boundary, reported by Coverity analysis.
Signed-off-by: York Sun <
[email protected]
>
CC: Joe Hershberger <
[email protected]
>
CC: Tom Rini <
[email protected]
>
CC: Prabhakar Kushwaha <
[email protected]
>
Reported-by: Coverity (CID: 163251)
Reviewed-by: Tom Rini <
[email protected]
>
Acked-by: Joe Hershberger <
[email protected]
>
cmd/ethsw.c
patch
|
blob
|
history
diff --git
a/cmd/ethsw.c
b/cmd/ethsw.c
index 491cb8eac385ed8ecf44ab6a2f46ab6bf57a59f9..b600965e8ad43a4764b519e5b89b8be1714dd17b 100644
(file)
--- a/
cmd/ethsw.c
+++ b/
cmd/ethsw.c
@@
-915,7
+915,7
@@
static void cmd_keywords_opt_check(const struct ethsw_command_def *parsed_cmd,
* check if our command's optional keywords match the optional
* keywords of an available command
*/
- for (i = 0; i < ARRAY_SIZE(
ethsw_cmd
_def); i++) {
+ for (i = 0; i < ARRAY_SIZE(
cmd_opt
_def); i++) {
keyw_opt_matched = 0;
cmd_keyw_p = &parsed_cmd->cmd_to_keywords[keyw_opt_matched];
cmd_keyw_opt_p = &cmd_opt_def[i].cmd_keyword[keyw_opt_matched];